/**
 * Creative List Module.
 */
define([
	'jquery',
	'listAsyncOp',
	'notification',
	'bootstrap-dialog',
	'loading',
	'formAjax'
	],
function($, VamListOp, VamOpMsg, BootstrapDialog, VamLoader, formAjax) {
	var CreativeList;
	// console.log(VamListOp);
	CreativeList = (function() {
		var renderList = function(data, makeHtml) {
			var $list = $('#creative-list-wrap'),
				tempalte, i, len, _creative, $flowplayer, iframeW, iframeH;

			//将String数据转换为JSON格式
			if ((typeof data) === 'string') {
				data = $.parseJSON(data);
			}
			iframeW = $list.width() / 3 - 30;
			for (i = 0, len = data.list.length; i < len; i++) {
				tempalte = data.list[i];
				_creative = makeHtml(tempalte, iframeW);
				$list.append(_creative);
			};
			$flowplayer = $('.flowplayer');
			// console.log($flowplayer);
			typeof $flowplayer.flowplayer === "function" ? $flowplayer.flowplayer() : void 0;
		};
		function CreativeList() {
			$('#list-loading-wrap').hide();
			this.init();
		}

		// Init.
		CreativeList.prototype.init = function() {
			this.vocationAndSizeInit();
		};
		// Vocation and Size Init.
		CreativeList.prototype.vocationAndSizeInit = function() {
			var $cbkBoxes = $('.filter-label').parent().siblings().find('.col-sm-2:gt(5)'),
				$listFilter = $('.list-filter');
			$cbkBoxes.addClass('vam-hidden');
			$listFilter.on('click', '.filter-label', function(evt) {
				var $me = $(this),
					$cbkBoxes = $me.parent().siblings().find('.col-sm-2:gt(5)'),
					$li = $me.children('.fa'),
					title = $me.attr('title');

				if (title === '点击回收') {
					$me.prop('title', '查看更多');
					$li.removeClass('fa-caret-down');
					$li.addClass('fa-caret-right');
				} else {
					$me.prop('title', '点击回收');
					$li.removeClass('fa-caret-right');
					$li.addClass('fa-caret-down');
				}
				$cbkBoxes.slideToggle('fast');
			});
			// Vocation filter checkbox operate.
			$listFilter.on('click', '.filter-eles > div > label', function(evt) {
				var $me = $(this),
					$subList = $me.parent().siblings('.popover');
				evt.preventDefault();
				$('.popover').hide();
				$subList.show().hover(
					function() {},
					function() {
					$subList.hide();
				});
			});
			$listFilter.on('change', '.filter-eles > div > input', function(evt) {
				var $me = $(this),
					$subListCkbs = $me.parent().siblings('.popover').find('input');
				$subListCkbs.prop('checked', this.checked);
				$me.parent().removeClass('half-checked');
			});
			$listFilter.on('change', '.popover input', function(evt) {
				var $me = $(this),
					$meParent = $me.parents('.popover'),
					$ckbGroup = $meParent.siblings(),
					$totalCkb = $ckbGroup.find('input'),
					ckbTotal = $meParent.find('input').length,
					checkedNum = $meParent.find('input:checked').length;
				if (ckbTotal === checkedNum) {
					$totalCkb.prop('checked', true);
					$ckbGroup.removeClass('half-checked');
				} else if ( checkedNum !== 0){
					$totalCkb.prop('checked', false);
					$ckbGroup.addClass('half-checked');
				} else {
					$totalCkb.prop('checked', false);
					$ckbGroup.removeClass('half-checked');
				}
			});
		};
		// Creative Data.
		CreativeList.prototype.creativeData = function(htmlRender) {
			var $container = $('#container'),
				$mainFilterFrm = $('#main-filter-frm'),
				$submitBtn = $mainFilterFrm.find('.btn-success'),
				$creativeListWrap = $('#creative-list-wrap'),
				$listLoadingWrap = $('#list-loading-wrap'),
				$searchPage = $('#search-page'), //搜索页数
				$pageNum = $('#page-num'), // 每页创意数
				$pageNumSelect = $('#page-num-select'),
				$pagination = $('.list-op-footer .pagination'),
				$pagerNumber = $('.pager-number'),
				$pagerLink = $('.pager-link'),
				$pageInfo = $('.dataTables_info'),
				$listFilter = $('.list-filter'),
				$pageModal = $('#page-modal'),
				$confirmModal = $('#confirm-modal'),
				$confirmModalBtn = $confirmModal.find('.confirm-btn'),
				$custonOption = $('#custom-option'),
				$txtareaModal = $('#modal-txtarea'),
				$creativeExportBtn = $('#creative-export-btn'),
				$childCheck, getAllChecks,
				$accountIdCkb = $('#id_ckb'),
				$adspace_shield = $('.adspace_shield'),
				$account_shield = $('.account_shield'),
				$cancel_shield = $('.cancel_shield'),
				$pass = $('.all-pass'),
				$refuse = $('.all-refuse'),
				$listLoadingWrap = new VamLoader().loader($('#list-loading-wrap')),
				pageInfoRender, pageNavRender, subPagerRender,
				operateConfirmModal,failModal,
				operateConfirmSelect = '<select class="form-control" id="operate-reason">'
									+ '<option value="广告创意不合规范">广告创意不合规范</option>'
									+ '<option value="创意无法正常预览">创意无法正常预览</option>'
									+ '<option value="目标网址无法正常跳转">目标网址无法正常跳转</option>'
									+ '<option value="自定义">自定义</option>'
									+ '</select>'
									+ '<div id="custom-option" style="display: none;">'
									+ '<textarea id="reason-txtarea" cols="30" rows="10" class="form-control mt10" placeholder="请输入原因"></textarea>'
									+ '<div class="help-block text-error" id="reason-err"></div></div>';

			// Page info render.
			pageInfoRender = function(count, pageCount) {
				var _currPage = window.parseInt($searchPage.val(), 10),
					_pageNum = $pageNumSelect.val(),
					PER_PAGE_MAX = _pageNum || 10,
					_perMin = (_currPage-1)*PER_PAGE_MAX + 1,
					_perMax = _currPage*PER_PAGE_MAX,
					_emptyInfo = '没有查到数据 :(',
					_info = '显示第 0 条数据 , 共 0 条',
					_pagination = '<li><span>上页</span></li><li><span>下页</span></li>';
				if (_currPage === pageCount) {
					_perMax = count;
				};
				if (count !== 0) {
					_info = '显示第 ' + _perMin + ' 至 ' + _perMax + ' 条数据，共 ' + count + ' 条';
				} else {
					$creativeListWrap.html('<p class="text-center">' + _emptyInfo + '</p>');
				};
				$pageInfo.text(_info);
			};
			// Sub pager render.
			subPagerRender = function(min, max, curr) {
				var sub = '', item;
				for (var i = min; i <= max; i++) {
					item = '';
					if (curr === i ) {
						item = '<li class="active"><span>' + curr + '</span></li>';
					} else {
						item = '<li><a href="#">' + i + '</a></li>';
					}
					sub += item;
				}
				return sub;
			};
			// Page nav render.
			pageNavRender = function(count, pageCount) {
				// console.log(count);
				// console.log(pageCount);
				var _pageNum = window.parseInt($searchPage.val(), 10),
					maxItem = window.parseInt($pageNum.val(), 10),
					MIN_PAGE = 5,
					MAX_PAGE = pageCount - 4,
					subStr = '',
					edge = '',
					pre = '',
					next = '',
					dom;
					// console.log(MIN_PAGE);
					// console.log(MAX_PAGE);
				if (count === 0 ) {
					$pagination.html('<li><span>上页</span></li><li><span>下页</span></li>');
					return;
				}
				if (pageCount <= MIN_PAGE) {
					if (_pageNum === 1) {
						pre = '<li class="disabled"><span>上页</span></li>'
					} else {
						pre = '<li><a href="#">上页</a></li>';
					}
					if (_pageNum === pageCount) {
						next = '<li class="disabled"><span>下页</span></li>'
					} else {
						next = '<li><a href="#">下页</a></li>';
					}
					dom = pre
							+ subPagerRender(1, pageCount, _pageNum)
							+ next;
				} else if (_pageNum >= MIN_PAGE && _pageNum <= MAX_PAGE) {
					dom = '<li><span>上页</span></li>'
							+ '<li><a href="#">1</a></li>'
							+ '<li class="disabled"><span> ... </span></li>'
							+ '<li><a href="#">' + (_pageNum-1) + '</a></li>'
							+ '<li class="active"><span>' + _pageNum + '</span></li>'
							+ '<li><a href="#">' + (_pageNum+1) + '</a></li>'
							+ '<li class="disabled"><span> ... </span></li>'
							+ '<li><a href="#">' + pageCount + '</a></li>'
							+ '<li><a href="#">下页</a></li>';
				} else if (_pageNum < MIN_PAGE) {
					if (_pageNum === 1) {
						edge = '<li class="disabled"><span>上页</span></li>'
					} else {
						edge = '<li><a href="#">上页</a></li>';
					}
					dom = edge
							+ subPagerRender(1, MIN_PAGE-1, _pageNum)
							+ '<li><a href="#">' + MIN_PAGE + '</a></li>'
							+ '<li class="disabled"><span> ... </span></li>'
							+ '<li><a href="#">' + pageCount + '</a></li>'
							+ '<li><a href="#">下页</a></li>';
				} else if (_pageNum > MAX_PAGE) {
					if (_pageNum === pageCount) {
						edge = '<li class="disabled"><span>下页</span></li>'
					} else {
						edge = '<li><a href="#">下页</a></li>';
					}
					dom = '<li><a href="#">上页</a></li>'
							+ '<li><a href="#">1</a></li>'
							+ '<li class="disabled"><span> ... </span></li>'
							+ '<li><a href="#">' + MAX_PAGE + '</a></li>'
							+ subPagerRender(MAX_PAGE+1, pageCount, _pageNum)
							+ edge;
				}
				$pagination.html(dom);
			};
			// 表单Ajax数据提交操作
			$mainFilterFrm.submit(function() {
				var $me = $(this);
				$me.ajaxSubmit({
					beforeSubmit: function() {
						$submitBtn.button('loading');
						$listLoadingWrap.show();
						// console.log($pageNumSelect.val());
						$pageNum.val($pageNumSelect.val());
						// console.log($pageNum.val());
						$creativeExportBtn.attr('href', VAM.getVar('ALL_EXPORT_OP') + '?' + $mainFilterFrm.serialize() + '&exportType=xls');
						$creativeListWrap.children().remove();
					},
					success: function(data) {
						// Back to root when session expire.
						VAM.backRoot(data);
						renderList(data, htmlRender);
						pageInfoRender(data.count, data.pageCount);
						pageNavRender(data.count, data.pageCount);
						$pagerLink.data('number', data.pageCount);
						$submitBtn.button('reset');
						$listLoadingWrap.fadeOut();
					},
					error: function () {
						console.log('Error! Request Data failure!')
					}
				});
				return false;
			});

			// 查询点击操作
			$submitBtn.on('click', function(evt) {
				$searchPage.val('1');
			});

			$pagination.on('click', 'li > a', function(evt) {
				// 上翻页&下翻页操作
				var $me = $(this),
					_currPage = window.parseInt($searchPage.val(), 10),
					_page = $me.text();

				evt.preventDefault();
				if (_page === '上页') {
					$searchPage.val(_currPage-1);
				} else if (_page === '下页') {
					$searchPage.val(_currPage+1);
				} else {
					_page = window.parseInt(_page, 10);
					$searchPage.val(_page);
				}
				$mainFilterFrm.trigger('submit');
			});

			// 页数跳转操作
			$pagerLink.on('click', function(evt) {
				var $me = $(this),
					totalNum = window.parseInt($me.data('number'), 10),
					number = $me.parents('.pager').find('.pager-number').val();
				// console.log( $me.parents('.pager').find('.pager-number'));
				evt.preventDefault();
				$pagerNumber.val('');
				if (number !== '' && !isNaN(number)) {
					number = window.parseInt(number, 10);
				} else {
					return;
				}
				// console.log(totalNum);
				// console.log(number);
				if (number > totalNum) {
					number = totalNum;
				}
				if (number >=1 && number <= totalNum) {
					$searchPage.val(number);
					$mainFilterFrm.trigger('submit');
				}
			});

			// 页数选择重新加载数据
			$pageNumSelect.on('change', function(evt) {
				var $me = $(this);
				$pageNum.val($me.val());
				$mainFilterFrm.submit();
			});

			// 初始化列表后发送数据查询请求
			// $mainFilterFrm.trigger('submit');

			// Creative list operate.
			// Get detail info.
			$creativeListWrap.on('click', '.tab-info-more', function(evt) {
				var $me = $(this),
					$hiddenInput = $me.siblings('input[name="crId"]'),
					opId = $hiddenInput.val(),
					opAdspaceId = $hiddenInput.data('adspace'),
					opType = $me.data('type'),
					opRole = $me.data('role'),
					opData;
				evt.preventDefault();
				opData = {
					guid: opId,
					adspaceId: opAdspaceId,
					role: opRole,
					type: opType,
					rnd: (new Date()).getTime()
				};
				$me.button('loading');
				VamListOp.listOp({
					url: VAM.getVar('LIST_INFO_DETAIL'),
					data: opData,
					success: function(data) {
						// console.log(data);
						var $detailsModal = $('#details-modal'),
							$modalCont = $detailsModal.find('.modal-body'),
							$tabAuditOp, $syncSwitch;
						$modalCont.html(data);
						$tabAuditOp = $('.tab-audit-op');
						$syncListContent = $('.details-sync-content');
						$syncSwitch = $('.sync-switch');
						$detailsModal.off('hidden.bs.modal').on('hidden.bs.modal', function (e) {
						  $modalCont.html('');
						});
						$detailsModal.modal();
					},
					always: function() {
						$me.button('reset');
					}
				});
			});
			// Get creative code.
			$creativeListWrap.on('click', '.tab-get-code', function(evt) {
				var $me = $(this),
					id = $me.siblings('input:first').val(),
					ctype = $me.siblings('input:last').val(),
					opData = {
						guid:id,
						type:ctype
					};
				evt.preventDefault();
				$me.button('loading');
				VamListOp.listOp({
					url: VAM.getVar('LIST_CODE_DETAIL'),
					type: 'POST',
					data: opData,
					success: function(data) {
						BootstrapDialog.show({
	            title: '查看创意代码',
	            type: BootstrapDialog.TYPE_INFO,
	            message: $('<textarea class="form-control" placeholder="创意代码" style="min-height: 250px;">' + data + '</textarea>'),
	            buttons: [{
                label: '关闭',
                action: function(dialogItSelf) {
                  dialogItSelf.close();
                }
	            }]
	        	});
					},
					always: function() {
						$me.button('reset');
					}
				});
			});

			// Reason select validate.
			$confirmModal.on('change','#operate-reason', function(evt) {
				var $me = $(this),
					$custonOption = $('#custom-option'),
					meVal = $me.val();
				evt.preventDefault();
				//console.log($me.val());
				if (meVal === '自定义') {
					$custonOption.slideDown('fast');
				} else {
					$custonOption.slideUp('fast');
				}
			});
			$confirmModal.on('blur', '#reason-txtarea', function(evt) {
				var meVal = $(this).val(),
					$reasonErr = $('#reason-err');
				evt.preventDefault();
				if (meVal === '') {
					$reasonErr.text('原因不能为空');
				} else if (meVal.length > 200) {
					$reasonErr.text('字符不能超过200个');
				} else {
					$reasonErr.text('');
				}
			});
			// Reason data bind.
			operateConfirmModal = function (op, opData, action) {
				var $confirmTitle = $confirmModal.find('.modal-title'),
					$confirmBody = $confirmModal.find('.modal-body');
				$confirmModalBtn.data('operateData', opData).removeClass('vam-hidden');
				$confirmModalBtn.data('action', action);
				if (op === 'account') {
					$confirmTitle.text('选择账号屏蔽的原因');
				} else if (op === 'adspace') {
					$confirmTitle.text('选择广告位屏蔽的原因');
				}
				$confirmBody.html(operateConfirmSelect);
				$confirmModal.modal();
			};
			// Confirm reason operate.
			$confirmModalBtn.on('click', function(evt) {
				var $me = $(this),
					$operateReasonTxt = $('#reason-txtarea'),
					operateReason = $('#operate-reason').val(),
					opData = $me.data('operateData'),
					action = $me.data('action');
				evt.preventDefault();
				if (operateReason !== '自定义') {
					opData.reason = operateReason;
				} else {
					$('#reason-txtarea').trigger('blur');
					if ($('#reason-err').text() !== '') {
						return;
					} else {
						opData.reason = $operateReasonTxt.val();
					}
				}
				VamListOp.listOp({
					url: VAM.getVar('LIST_REFUSE_OP'),
					data: opData,
					success: function(data) {
						VamOpMsg.messager(data);
					},
					always: function() {
						$mainFilterFrm.trigger('submit');
						$confirmModal.modal('hide');
						if ($accountIdCkb.get(0).checked){
							$accountIdCkb.prop('checked',false);
						}
					}
				});
			});
			// List audit pass operate.
			$creativeListWrap.on('click', '.tab-audit-op', function(evt) {
				var $me = $(this),
					opId = $me.parent().siblings('input[name="crId"]').val(),
					opType = $me.data('type'),
					opOperate = $me.data('operate'),
					action = $me.data('action'),
					opData;
				evt.preventDefault();
				opData = {
					guid: opId,
					type: opType,
					action: action,
					operate: opOperate,
					rnd: (new Date()).getTime()
				};
				$me.button('loading');
				VamListOp.listOp({
					url: VAM.getVar('LIST_PASS_OP'),
					data: opData,
					success: function(data) {
						VamOpMsg.messager(data);
					},
					always: function() {
						$me.button('reset');
						$mainFilterFrm.trigger('submit');
					}
				});
			});
			// List audit refuse operate.
			$creativeListWrap.on('click', '.tab-audit-refuse-op', function(evt) {
				var $me = $(this),
					$hiddenInput = $me.parents('.btn-group').siblings('input[name="crId"]'),
					opId = $hiddenInput.val(),
					opType = $me.data('type'),
					action = $me.data('action'),
					opOperate = $me.data('operate'),
					opData;
				evt.preventDefault();
				opData = {
					guid: opId,
					type: opType,
					action: action,
					operate: opOperate,
					rnd: (new Date()).getTime()
				};
				operateConfirmModal(opOperate, opData, action);
			})
			// List adspace/account shield operate.
			$creativeListWrap.on('click', '.tab-shield-op', function(evt) {
				var $me = $(this),
					$hiddenInput = $me.parents('.btn-group').siblings('input[name="crId"]'),
					opId = $hiddenInput.val(),
					adspaceId = $hiddenInput.data('adspace'),
					opType = $me.data('type'),
					action = $me.data('action'),
					opOperate = $me.data('operate'),
					opData;
				evt.preventDefault();
				opData = {
					guid: opId,
					adspaceId: adspaceId,
					type: opType,
					action: action,
					operate: opOperate,
					rnd: (new Date()).getTime()
				};
				operateConfirmModal(opOperate, opData, action);
			});
			// List cancel shield operate.
			$creativeListWrap.on('click', '.tab-cancel-shield-op', function(evt) {
				var $me = $(this),
					$hiddenInput = $me.parents('.btn-group').siblings('input[name="crId"]'),
					opId = $hiddenInput.val(),
					adspaceId = $hiddenInput.data('adspace'),
					opType = $me.data('type'),
					opOperate = $me.data('operate'),
					action = $me.data('action'),
					opData;
				evt.preventDefault();
				opData = {
					guid: opId,
					adspaceId: adspaceId,
					type: opType,
					action: action,
					operate: opOperate,
					rnd: (new Date()).getTime()
				};
				$me.button('loading');
				VamListOp.listOp({
					url: VAM.getVar('LIST_REFUSE_OP'),
					data: opData,
					success: function(data) {
						VamOpMsg.messager(data);
					},
					always: function() {
						$me.button('reset');
						$mainFilterFrm.trigger('submit');
					}
				});
			});

			// Bash operate begin.
			// Check all/
			$accountIdCkb.on( 'click', function(){
				$childCheck=$('.child_check');
				for (var i = 0, l=$childCheck.length; i<l; i++){
					$childCheck[i].checked = $accountIdCkb.get(0).checked;
				}
			});
			// Child cascade all.
			$creativeListWrap.on('click', '.child_check', function(){
				var allChecked = true,
				    $childCheck = $('.child_check');
				if (this.checked){
					for (var i = 0, l=$childCheck.length; i<l; i++) {
						if (!$childCheck[i].checked){
							allChecked = false;
							break;
						}
					}
					if (allChecked && !$accountIdCkb.get(0).checked) {
						$accountIdCkb.get(0).checked = true;
					}
				} else {
					if ( $accountIdCkb.get(0).checked ) {
						$accountIdCkb.get(0).checked = false;
					}
				}
			});

			// Bash adspace/account shield operate.
			failModal = function(){
				var $confirmTitle = $confirmModal.find('.modal-title');
					$confirmBody = $confirmModal.find('.modal-body');
				$confirmTitle.text('没有选中');
				$confirmBody.html("至少选中一个！");
				$confirmModalBtn.addClass('vam-hidden');
				$confirmModal.modal();
			};
			getAllChecks = function(){
				var ret = [],
					adspaceIdRet = [],
					$tmp,
					$childCheck = $('.child_check');
				for( i = 0, l = $childCheck.length; i < l; i++ ){
        	$tmp = $( $childCheck[i] );
        	!!$tmp.prop('checked') && ret.push( $tmp.val() );
      	}
      	return ret.join(',');
			};
			$adspace_shield.on('click', function(evt){
				var $me = $(this),
					check_num = getAllChecks();

				if (!check_num || check_num.length < 1) {
					failModal();
				} else {
					var opType = $me.data('type'),
						action = $me.data('action'),
						opOperate = $me.data('operate'),
						opData;
						evt.preventDefault();

					opData = {
						data: check_num,
						type: opType,
						operate: opOperate,
						rnd: (new Date()).getTime()
					};
					operateConfirmModal(opOperate, opData, action);
				}
			});
			$account_shield.on('click', function(evt){
				var $me = $(this),
					check_num = getAllChecks();

				if (!check_num || check_num.length < 1) {
					failModal();
				} else {
					var opType = $me.data('type'),
						action = $me.data('action'),
						opOperate = $me.data('operate'),
						opData;
						evt.preventDefault();

					opData = {
						data: check_num,
						type: opType,
						action: action,
						operate: opOperate,
						rnd: (new Date()).getTime()
					};
					operateConfirmModal(opOperate, opData, action);
				}
			});
			$cancel_shield.on('click', function(evt){
				var $me = $(this),
					check_num = getAllChecks();
				if (!check_num || check_num.length < 1) {
					failModal();
				} else {
					var opType = $me.data('type'),
						action = $me.data('action'),
						opOperate = $me.data('operate'),
						opData;
						evt.preventDefault();

					opData = {
						data: check_num,
						type: opType,
						action: action,
						operate: opOperate,
						rnd: (new Date()).getTime()
					};
					$me.button('loading');
					VamListOp.listOp({
						url: VAM.getVar('LIST_REFUSE_OP'),
						data: opData,
						success: function(data) {
							VamOpMsg.messager(data);
						},
						always: function() {
							$me.button('reset');
							$mainFilterFrm.trigger('submit');
							if ($accountIdCkb.get(0).checked){
								$accountIdCkb.prop('checked',false);
							}
						}
					});
				}
			});

			$refuse.on('click', function(evt){
				var $me = $(this),
					check_num = getAllChecks();
				if (!check_num || check_num.length < 1) {
					failModal();
				} else {
					var $me = $(this),
					opId = check_num,
					opType = $me.data('type'),
					action = $me.data('action'),
					opOperate = $me.data('operate'),
					opData;
					evt.preventDefault();
					opData = {
						data: opId,
						type: opType,
						action: action,
						operate: opOperate,
						rnd: (new Date()).getTime()
					};
					operateConfirmModal(opOperate, opData, action);
				}
			});
			$pass.on('click', function(evt){
				var $me = $(this),
					check_num = getAllChecks();
				if (!check_num || check_num.length < 1) {
					failModal();
				} else {
					var $me = $(this),
					opId = check_num,
					opType = $me.data('type'),
					opOperate = $me.data('operate'),
					action = $me.data('action'),
					opData;
					evt.preventDefault();
					opData = {
						data: opId,
						type: opType,
						action: action,
						operate: opOperate,
						rnd: (new Date()).getTime()
					};
					$me.button('loading');
					VamListOp.listOp({
						url: VAM.getVar('LIST_REFUSE_OP'),
						data: opData,
						success: function(data) {
							VamOpMsg.messager(data);
						},
						always: function() {
							$me.button('reset');
							$mainFilterFrm.trigger('submit');
							if ($accountIdCkb.get(0).checked){
								$accountIdCkb.prop('checked',false);
							}
						}
					});
				}
			});
			// Bash operate end.
		};
		// Creative Operate.
		CreativeList.prototype.creativeOp = function() {

		};

		return CreativeList;
	})();

	return CreativeList;
});
